package com.eshore.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

@SuppressWarnings("deprecation")
@Configuration
public class HystrixDashboardWebMvcConfig extends WebMvcConfigurerAdapter {
	/**
	 * 配置静态访问资源
	 * 
	 * @param registry
	 */
	@Override
	public void addResourceHandlers(ResourceHandlerRegistry registry) {
		registry.addResourceHandler("/hystrix/components/hystrixCommand/templates/**", "/hystrix/components/hystrixCommand/**", 
				"/hystrix/components/hystrixThreadPool/templates/**", "/hystrix/components/hystrixThreadPool/**",
				"/hystrix/css/simplegrid/**", "/hystrix/css/**",
				"/hystrix/js/**",
				"/hystrix/images/**")
				.addResourceLocations("classpath:/static/hystrix/components/hystrixCommand/templates/",
						"classpath:/static/hystrix/components/hystrixCommand/",
						"classpath:/static/hystrix/components/hystrixThreadPool/templates/",
						"classpath:/static/hystrix/components/hystrixThreadPool/",
						"classpath:/static/hystrix/css/simplegrid/",
						"classpath:/static/hystrix/css/",
						"classpath:/static/hystrix/images/",
						"classpath:/static/hystrix/js/");
		super.addResourceHandlers(registry);
	}
}